package designmode.headfirst.strategy.duck;

import designmode.headfirst.strategy.action.eat.EatAction;
import designmode.headfirst.strategy.action.fly.FlyAction;

/**
 * 鸭子类
 * <p>Filename: dp.headFirst.策略模式.duck.Duck.java</p>
 * <p>Date: 2020-09-24 17:07.</p>
 *
 * @author <a href="mailto:liufuguo@qianmi.com">OF3581-刘富国</a>
 * @version 0.1.0
 */
public abstract class BaseDuck {

    /**
     * 飞
     */
    protected FlyAction flyAction;

    /**
     * 吃
     */
    protected EatAction eatAction;

    /**
     * 介绍
     */
    public abstract void introduce();


    public void execFly() {
        flyAction.fly();
    }

    public void execEat() {
        eatAction.eat();
    }

    public void setFlyAction(FlyAction flyAction) {
        this.flyAction = flyAction;
    }

    public void setEatAction(EatAction eatAction) {
        this.eatAction = eatAction;
    }
}
